public class Color
{
    private int color;
    Color()
    {
        this(0,0,0);
    }
    Color(Color c)
    {
        color=c.color;
    }
    Color(final int r,final int g,final int b)
    {
        color=0XFF000000|((r&0XFF)<<16)|((g&0XFF)<<8)|((b&0XFF)<<0);
    }
    public String toString()
    {
        return String.format("0X%8X R:%d G:%d B:%d",color,getR(),getG(),getB());
    }
    public int getR()
    {
        return (color>>16)&0XFF;
    }
    public int getG()
    {
        return (color>>8)&0XFF;
    }
    public int getB()
    {
        return (color>>0)&0XFF;
    }
    public void setR(final int r)
    {
        color=(color&0XFF00FFFF)|((r&0XFF)<<16);
    }
    public void setG(final int g)
    {
        color=(color&0XFFFF00FF)|((g&0XFF)<<8);
    }
    public void setB(final int b)
    {
        color=(color&0XFFFFFF00)|((b&0XFF)<<0);
    }
}
